<?php
$this->layout()->disableLayout();
switch ($this->type) {
	case "javascript":
?>
// Загружаем все необходимые скрипты
dojo.xhrGet({
		url: '/cms/scripts/tabWidget.js',
		handleAs: "javascript",
		sync: true
	});


new mfTabWidget('editAdminTabs');

dojo.query('#editAdminCloseBtn, #editAdminBackTab')
	.onclick(function () {
			dojo.destroy('editAdminBox');
			dojo.query('#adminListBox').removeClass('isHidden');
			dojo.destroy(editAdminStylesheet);
		});
		
dojo.query('#editAdminSubmitBtn').onclick(
	function () {
		dojo.xhrPost({
				url: '/cms/administrator/edit/type/save/id/<?= $this->administrator_id ?>',
				load: function(response, ioArgs) {
						if (response['ok']=='1') {
							dojo.destroy('editAdminBox');
							dojo.query('#adminListBox').removeClass('isHidden');
							dojo.destroy(editAdminStylesheet);
							dojo.publish('onsaveok',[]);
						} 
					},
				error: function (response, ioArgs){
						alert("An error occurred, with response: " + response);
						return response;
					},
				form: 'editAdminForm',
				handleAs:"json",
				sunc: true
			});
		
	});
	
var editAdminStylesheet = dojo.create('link',{rel:'stylesheet',type:'text/css',href:'/cms/administrator/edit/type/css/id/<?= $this->administrator_id ?>'},dojo.query('head')[0]);
<?php 
		break;
	case "css":
?> 
.labelBox {
	width: 150px;
}
.inputBox input, .inputBox textarea {
	width: 300px;
}
.modalControlsBox {
	padding-left: 160px;
}

h1 {
	padding-left: 154px;
}
<?php
		break;
	case "html":
?>
<ul id="editAdminTabs">
  <li><a class="isActive back" id="editAdminBackTab">Назад к списку администраторов</a></li>
  <li class="active"><a>Изменение администратора</a></li>
</ul>
<div class="modalContent">
  <h1>Изменение администратора</h1>
  <form id="editAdminForm">
    <div class="labelBox">Логин:</div>
    <div class="inputBox">
    <input type="text" class="modalInput" disabled="disabled" value="<?= $this->login ?>"  /> 
    </div>
    <div class="antifloat"></div>
    <div class="labelBox">Имя:</div>
    <div class="inputBox">
    <input name="name" type="text" class="modalInput" id="name" value="<?= $this->name ?>" /></div>
    <div class="antifloat"></div>
    <div class="labelBox">Примечание:</div>
    <div class="inputBox">
      <textarea name="summary" rows="5" class="modalInput" id="summary"><?= htmlspecialchars($this->summary) ?></textarea>
    </div>
    <div class="antifloat"></div>
  </form>
</div>
<div class="modalControls">
  <div class="controllGrad"></div>
  <div class="modalControlsBox">
    <input type="button" class="okButton" value="Сохранить" id="editAdminSubmitBtn" />
    <input type="button" class="okButton" value="Закрыть" id="editAdminCloseBtn" />
  </div>
</div>

<?php 	
		break;
	
	default:
?>

<?php 
	break;
}
?>